package com.agent.membership.api.feign;

import com.agent.common.result.ApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;

/**
 * 会员Feign客户端
 * @author Jeff_Wan
 * @description 提供其他服务调用会员服务的接口
 */
@FeignClient(name = "agent-membership", contextId = "membership", path = "/api/membership")
public interface MembershipFeignClient {

    /**
     * 升级会员
     * @param userId 用户ID
     * @param planType 套餐类型
     * @param subscriptionType 订阅类型
     * @param originalPlan 原始套餐
     * @param creditConversion 积分抵扣金额
     * @return 操作结果
     */
    @PostMapping("/upgrade")
    ApiResponse<String> upgradeMembership(
            @RequestParam("userId") Long userId,
            @RequestParam("planType") String planType,
            @RequestParam("subscriptionType") String subscriptionType,
            @RequestParam(name = "originalPlan", required = false) String originalPlan,
            @RequestParam(name = "creditConversion",required = false) BigDecimal creditConversion
    );
}